package co.yixiang.modules.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author seven
 * @Package co.yixiang.modules.system.enums
 * @date 2020/8/29 11:29
 */
@Getter
@AllArgsConstructor
public enum VipBuyStatusEnum {

    /**
     * UNPAID
     *
     * 未支付
     */
    UNPAID("0", "未支付"),

    /**
     * pay
     *
     * 已支付
     */
    ALREADY_PAY("1","已支付");

    private String value;

    private String desc;

    public static VipBuyStatusEnum toType(String value) {
        return Stream.of(VipBuyStatusEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }

    public String value() {
        return this.value;
    }
}
